package weather.language.forecast;

import java.util.*;

public class TemperatureGroup extends WeatherGroup
{
	public static final String HIGH_TEMP = "HIGH"; 
	public static final String LOW_TEMP = "LOW"; 
	public static final String AVG_TEMP = "AVG"; 
	
	public TemperatureGroup(String id)
	{
		super(id);
		if(id.toUpperCase().startsWith(HIGH_TEMP))
			isHigh = true;
		else if(id.toUpperCase().startsWith(LOW_TEMP))
			isLow = true;
		else if(id.toUpperCase().startsWith(AVG_TEMP))
			isAverage = true;
		else
		{
			isHigh = true;
			isLow = true;
			isAverage = true;
		}
		
	}
	
	public TemperatureGroup(String id, Set<String> keywordsSet)
	{
		super(id, keywordsSet);
		if(id.toUpperCase().startsWith(HIGH_TEMP))
			isHigh = true;
		else if(id.toUpperCase().startsWith(LOW_TEMP))
			isLow = true;
		else if(id.toUpperCase().startsWith(AVG_TEMP))
			isAverage = true;
		else
		{
			isHigh = true;
			isLow = true;
			isAverage = true;
		}
	}

	@Override
	public void prepareQuestion(WeatherQuestion weatherQ) 
	{
		if(isHigh)
			weatherQ.setQuestionAboutHighTemperature(true);
		if(isLow)
			weatherQ.setQuestionAboutLowTemperature(true);
		if(isAverage)
			weatherQ.setQuestionAboutAverageTemperature(true);
		
	}
	
	private boolean isHigh = false;
	private boolean isLow = false;
	private boolean isAverage = false;
}
